package com.javaer666.spitest;

import java.util.ServiceLoader;

/**
 * Created by IntelliJ IDEA.
 * User: bj910
 * Date:2023-10-23
 * Time: 13:48
 * To change this template use File | Settings | File Templates.
 */
public class SpiTest {
    public static void main(String[] args) {
        ServiceLoader<Animal> load = ServiceLoader.load(Animal.class);
        for (Animal animal : load) {
            animal.eat();
        }
    }
}
